package cn.ydt.ydt.community.webapi.controller;

import cn.ydt.ydt.common.pojo.domain.UserJwtVO;
import cn.ydt.ydt.common.resful.JsonResult;
import cn.ydt.ydt.common.resful.StatusCode;
import cn.ydt.ydt.community.common.utils.SecurityContextUtils;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
@Slf4j(topic = "community.test")
public class TestController {
    @ApiOperation(value = "测试连接")
    @GetMapping("/test1")
    public JsonResult test(){
        UserJwtVO userInfo = SecurityContextUtils.getUserInfo();
       log.info("登录用户信息h：{}" , userInfo);
        return JsonResult.ok(StatusCode.OK , "测试访问成功");
    }
}
